@extends(Request::ajax() ? 'layouts.partial' : 'layouts.app')

@section('content')

<div class='row'>
      <p>
@foreach ($object->showFields() as $label=>$val)
        <strong>{{$label}}:</strong> {{ $val }}<br>
@endforeach
      </p>
</div>

<div id='delete-confirm' class='reveal-modal' data-reveal>
{{ Form::open(array ('url'=>'/'. $object->getTable() .'/' . $object->id, 'method'=>'delete')) }}
<p>
Are you sure you want to delete?  <br />
This cannot be undone.
</p>

  <input type='submit' class='button' value='delete' />
  <a class="button alert" href="/{{$object->getTable()}}">cancel</a>
  <a class="close-reveal-modal">&#215;</a>
{{ Form::close() }}
</div>


<div class='row'>
  <input type='button' class='button' value='edit' onClick="document.location='/{{$object->getTable()}}/{{$object->id}}/edit'">
@if ($allow_delete)
<button data-reveal-id="delete-confirm">delete</button>
@endif


</div>
@stop